package uesr;

import operation.action.*;
import operation.user.*;

import java.util.Random;
import java.util.Scanner;

public class Business extends User{
    public long phone;// 注册手机号码
    public int size;// 商品商品数量



    public Business () {
        goods_operations = new Goods_Operation[] {
                new AddGoods(),
                new RemoveGoods(),
                new SelectGoods(),
                new UpdateGoods()
        };
        user_operations = new User_Operation[] {
                new Register(),
                new Login(),
                new Menu(),
                new Exit()
        };
    }
    public void register() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的昵称");
        String name = scanner.next();
        System.out.println("请输入你的密码");
        int password = scanner.nextInt();
        System.out.println("请输入注册的手机号码");
        int phone = scanner.nextInt();
        this.name = name;
        this.password = password;
        this.phone = phone;
        Random random = new Random();

        int account = random.nextInt(100_000_000);
        System.out.println("注册成功,请保存好账号密码," + name);
        System.out.println("账号 " + account);
        System.out.println("密码 " + password);
    }

    @Override
    public int goods_menu() {
        System.out.println("1 增加菜品");
        System.out.println("2 删除菜品");
        System.out.println("3 查看菜品");
        System.out.println("4 修改菜品");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;
    }


}
